<?php


namespace App\Libs\Contracts\Push;


use App\Libs\Contracts\Push\Huawei\HuaweiPushService;
use App\Libs\Contracts\Push\Jpush\JpushServer;
use App\Libs\Contracts\Push\Oppo\OppoPushService;
use App\Libs\Contracts\Push\Vivo\VivoPushService;
use App\Libs\Contracts\Push\Xm\XmpushService;

class PushService
{
    public static function push($title, $content, $userId)
    {
        //华为推送
        $huaweiPush = new HuaweiPushService();
        $huaweiPush->push($title, $content, $userId);
        //极光推送
        $jpush = new JpushServer();
        $jpush->push($title, $content, $userId);
        //Oppo推送
        $oppoPush = new OppoPushService();
        $oppoPush->push($title, $content, $userId);
        //ViVO 推送
        $vivoPush = new VivoPushService();
        $vivoPush->push($title, $content, $userId);
        //小米推送
        $xmPush = new XmpushService();
        $xmPush->push($title, $content, $userId);
    }

    public static function pushOne($title, $content, $userId,$array,$appType= "USER")
    {
//        //华为推送
//        $huaweiPush = new HuaweiPushService();
//        $huaweiPush->push($title, $content, $userId);
        //极光推送
        $jpush = new JpushServer();
        $jpush->pushOne($title, $content, $userId,$array,$appType);
//        //Oppo推送
//        $oppoPush = new OppoPushService();
//        $oppoPush->push($title, $content, $userId);
//        //ViVO 推送
//        $vivoPush = new VivoPushService();
//        $vivoPush->push($title, $content, $userId);
//        //小米推送
//        $xmPush = new XmpushService();
//        $xmPush->push($title, $content, $userId);
    }
}